3.204 \(\int x \cos ^2(x) \cot ^2(x) \, dx\)

Optimal. Leaf size=33 \[ -\frac {3 x^2}{4}-\frac {\cos ^2(x)}{4}-x \cot (x)+\log (\sin (x))-\frac {1}{2} x \sin (x) \cos (x) \]

[Out]

-3/4*x^2-1/4*cos(x)^2-x*cot(x)+ln(sin(x))-1/2*x*cos(x)*sin(x)

________________________________________________________________________________________

Rubi [A]  time = 0.05, antiderivative size = 33, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, integrand size = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.500, Rules used = {4408, 3310, 30, 3720, 3475} \[ -\frac {3 x^2}{4}-\frac {\cos ^2(x)}{4}-x \cot (x)+\log (\sin (x))-\frac {1}{2} x \sin (x) \cos (x) \]

Antiderivative was successfully verified.

[In]

Int[x*Cos[x]^2*Cot[x]^2,x]

[Out]

(-3*x^2)/4 - Cos[x]^2/4 - x*Cot[x] + Log[Sin[x]] - (x*Cos[x]*Sin[x])/2

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rule 3310

Int[((c_.) + (d_.)*(x_))*((b_.)*sin[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[(d*(b*Sin[e + f*x])^n)/(f^2*n
^2), x] + (Dist[(b^2*(n - 1))/n, Int[(c + d*x)*(b*Sin[e + f*x])^(n - 2), x], x] - Simp[(b*(c + d*x)*Cos[e + f*
x]*(b*Sin[e + f*x])^(n - 1))/(f*n), x]) /; FreeQ[{b, c, d, e, f}, x] && GtQ[n, 1]

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3720

Int[((c_.) + (d_.)*(x_))^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[(b*(c + d*x)^m*(b*Tan[e
 + f*x])^(n - 1))/(f*(n - 1)), x] + (-Dist[(b*d*m)/(f*(n - 1)), Int[(c + d*x)^(m - 1)*(b*Tan[e + f*x])^(n - 1)
, x], x] - Dist[b^2, Int[(c + d*x)^m*(b*Tan[e + f*x])^(n - 2), x], x]) /; FreeQ[{b, c, d, e, f}, x] && GtQ[n,
1] && GtQ[m, 0]

Rule 4408

Int[Cos[(a_.) + (b_.)*(x_)]^(n_.)*Cot[(a_.) + (b_.)*(x_)]^(p_.)*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> -Int[
(c + d*x)^m*Cos[a + b*x]^n*Cot[a + b*x]^(p - 2), x] + Int[(c + d*x)^m*Cos[a + b*x]^(n - 2)*Cot[a + b*x]^p, x]
/; FreeQ[{a, b, c, d, m}, x] && IGtQ[n, 0] && IGtQ[p, 0]

Rubi steps

\begin {align*} \int x \cos ^2(x) \cot ^2(x) \, dx &=-\int x \cos ^2(x) \, dx+\int x \cot ^2(x) \, dx\\ &=-\frac {1}{4} \cos ^2(x)-x \cot (x)-\frac {1}{2} x \cos (x) \sin (x)-\frac {\int x \, dx}{2}-\int x \, dx+\int \cot (x) \, dx\\ &=-\frac {3 x^2}{4}-\frac {\cos ^2(x)}{4}-x \cot (x)+\log (\sin (x))-\frac {1}{2} x \cos (x) \sin (x)\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.02, size = 33, normalized size = 1.00 \[ -\frac {3 x^2}{4}-\frac {1}{4} x \sin (2 x)-\frac {1}{8} \cos (2 x)-x \cot (x)+\log (\sin (x)) \]

Antiderivative was successfully verified.

[In]

Integrate[x*Cos[x]^2*Cot[x]^2,x]

[Out]

(-3*x^2)/4 - Cos[2*x]/8 - x*Cot[x] + Log[Sin[x]] - (x*Sin[2*x])/4

________________________________________________________________________________________

fricas [A]  time = 0.46, size = 45, normalized size = 1.36 \[ \frac {4 \, x \cos \relax (x)^{3} - 12 \, x \cos \relax (x) - {\left (6 \, x^{2} + 2 \, \cos \relax (x)^{2} - 1\right )} \sin \relax (x) + 8 \, \log \left (\frac {1}{2} \, \sin \relax (x)\right ) \sin \relax (x)}{8 \, \sin \relax (x)} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*cos(x)^2*cot(x)^2,x, algorithm="fricas")

[Out]

1/8*(4*x*cos(x)^3 - 12*x*cos(x) - (6*x^2 + 2*cos(x)^2 - 1)*sin(x) + 8*log(1/2*sin(x))*sin(x))/sin(x)

________________________________________________________________________________________

giac [B]  time = 0.22, size = 206, normalized size = 6.24 \[ -\frac {6 \, x^{2} \tan \left (\frac {1}{2} \, x\right )^{5} - 4 \, x \tan \left (\frac {1}{2} \, x\right )^{6} - 4 \, \log \left (\frac {16 \, \tan \left (\frac {1}{2} \, x\right )^{2}}{\tan \left (\frac {1}{2} \, x\right )^{4} + 2 \, \tan \left (\frac {1}{2} \, x\right )^{2} + 1}\right ) \tan \left (\frac {1}{2} \, x\right )^{5} + 12 \, x^{2} \tan \left (\frac {1}{2} \, x\right )^{3} - 12 \, x \tan \left (\frac {1}{2} \, x\right )^{4} + \tan \left (\frac {1}{2} \, x\right )^{5} - 8 \, \log \left (\frac {16 \, \tan \left (\frac {1}{2} \, x\right )^{2}}{\tan \left (\frac {1}{2} \, x\right )^{4} + 2 \, \tan \left (\frac {1}{2} \, x\right )^{2} + 1}\right ) \tan \left (\frac {1}{2} \, x\right )^{3} + 6 \, x^{2} \tan \left (\frac {1}{2} \, x\right ) + 12 \, x \tan \left (\frac {1}{2} \, x\right )^{2} - 6 \, \tan \left (\frac {1}{2} \, x\right )^{3} - 4 \, \log \left (\frac {16 \, \tan \left (\frac {1}{2} \, x\right )^{2}}{\tan \left (\frac {1}{2} \, x\right )^{4} + 2 \, \tan \left (\frac {1}{2} \, x\right )^{2} + 1}\right ) \tan \left (\frac {1}{2} \, x\right ) + 4 \, x + \tan \left (\frac {1}{2} \, x\right )}{8 \, {\left (\tan \left (\frac {1}{2} \, x\right )^{5} + 2 \, \tan \left (\frac {1}{2} \, x\right )^{3} + \tan \left (\frac {1}{2} \, x\right )\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*cos(x)^2*cot(x)^2,x, algorithm="giac")

[Out]

-1/8*(6*x^2*tan(1/2*x)^5 - 4*x*tan(1/2*x)^6 - 4*log(16*tan(1/2*x)^2/(tan(1/2*x)^4 + 2*tan(1/2*x)^2 + 1))*tan(1
/2*x)^5 + 12*x^2*tan(1/2*x)^3 - 12*x*tan(1/2*x)^4 + tan(1/2*x)^5 - 8*log(16*tan(1/2*x)^2/(tan(1/2*x)^4 + 2*tan
(1/2*x)^2 + 1))*tan(1/2*x)^3 + 6*x^2*tan(1/2*x) + 12*x*tan(1/2*x)^2 - 6*tan(1/2*x)^3 - 4*log(16*tan(1/2*x)^2/(
tan(1/2*x)^4 + 2*tan(1/2*x)^2 + 1))*tan(1/2*x) + 4*x + tan(1/2*x))/(tan(1/2*x)^5 + 2*tan(1/2*x)^3 + tan(1/2*x)
)

________________________________________________________________________________________

maple [B]  time = 0.12, size = 76, normalized size = 2.30 \[ \frac {-x -\frac {x^{2} \tan \relax (x )}{2}}{2 \tan \relax (x )}-\frac {\ln \left (1+\tan ^{2}\relax (x )\right )}{2}+\ln \left (\tan \relax (x )\right )+\frac {-\frac {\tan \relax (x )}{2}-x -2 x \left (\tan ^{2}\relax (x )\right )-x^{2} \tan \relax (x )-x^{2} \left (\tan ^{3}\relax (x )\right )}{2 \tan \relax (x ) \left (1+\tan ^{2}\relax (x )\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*cos(x)^2*cot(x)^2,x)

[Out]

1/2*(-x-1/2*x^2*tan(x))/tan(x)-1/2*ln(1+tan(x)^2)+ln(tan(x))+1/2*(-1/2*tan(x)-x-2*x*tan(x)^2-x^2*tan(x)-x^2*ta
n(x)^3)/tan(x)/(1+tan(x)^2)

________________________________________________________________________________________

maxima [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: RuntimeError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*cos(x)^2*cot(x)^2,x, algorithm="maxima")

[Out]

Exception raised: RuntimeError >> ECL says: THROW: The catch RAT-ERR is undefined.

________________________________________________________________________________________

mupad [B]  time = 1.23, size = 56, normalized size = 1.70 \[ \ln \left ({\mathrm {e}}^{x\,2{}\mathrm {i}}-1\right )-{\mathrm {e}}^{-x\,2{}\mathrm {i}}\,\left (\frac {1}{16}+\frac {x\,1{}\mathrm {i}}{8}\right )+{\mathrm {e}}^{x\,2{}\mathrm {i}}\,\left (-\frac {1}{16}+\frac {x\,1{}\mathrm {i}}{8}\right )-\frac {3\,x^2}{4}-x\,2{}\mathrm {i}-\frac {x\,2{}\mathrm {i}}{{\mathrm {e}}^{x\,2{}\mathrm {i}}-1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*cos(x)^2*cot(x)^2,x)

[Out]

log(exp(x*2i) - 1) - x*2i - exp(-x*2i)*((x*1i)/8 + 1/16) + exp(x*2i)*((x*1i)/8 - 1/16) - (x*2i)/(exp(x*2i) - 1
) - (3*x^2)/4

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int x \cos ^{2}{\relax (x )} \cot ^{2}{\relax (x )}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*cos(x)**2*cot(x)**2,x)

[Out]

Integral(x*cos(x)**2*cot(x)**2, x)

________________________________________________________________________________________